﻿using Oracle.ManagedDataAccess.Client;
using System.Data;

namespace Sprout.Repository
{
    internal static class OracleHelper
    {
        /// <summary>
        /// 通过连接字符串获取连接对象
        /// </summary>
        /// <param name="connectionString">连接字符串</param>
        /// <returns></returns>
        public static IDbConnection GetConnection(string connectionString)
        {
            return new OracleConnection(connectionString); 
        }

        /// <summary>
        /// 验证连接对象
        /// </summary>
        /// <param name="connection"></param>
        /// <returns></returns>
        public static bool IsConnection(IDbConnection connection)
        {
            return connection is OracleConnection;
        }
    }
}
